import request from '@/utils/request'

// 查询钓技文章列表
export function listTechnique(query) {
  return request({
    url: '/pond/app/fishing/technique/list',
    method: 'get',
    params: query
  })
}

// 查询钓技文章详细
export function getTechnique(id) {
  return request({
    url: '/pond/app/fishing/technique/' + id,
    method: 'get'
  })
}

// 新增钓技文章
export function addTechnique(data) {
  return request({
    url: '/pond/app/fishing/technique',
    method: 'post',
    data: data
  })
}

// 修改钓技文章
export function updateTechnique(data) {
  return request({
    url: '/pond/app/fishing/technique',
    method: 'put',
    data: data
  })
}

// 删除钓技文章
export function delTechnique(id) {
  return request({
    url: '/pond/app/fishing/technique/' + id,
    method: 'delete'
  })
}

// 导出钓技文章
export function exportTechnique(query) {
  return request({
    url: '/pond/app/fishing/technique/export',
    method: 'get',
    params: query
  })
}

// 点赞文章
export function likeTechnique(id) {
  return request({
    url: '/pond/app/fishing/technique/' + id + '/like',
    method: 'post'
  })
}

// 收藏文章
export function favoriteTechnique(id) {
  return request({
    url: '/pond/app/fishing/technique/' + id + '/favorite',
    method: 'post'
  })
}

// 获取分类选项
export function getCategoryOptions() {
  return request({
    url: '/pond/app/fishing/technique/categories',
    method: 'get'
  })
}

// 获取难度选项
export function getDifficultyOptions() {
  return request({
    url: '/pond/app/fishing/technique/difficulties',
    method: 'get'
  })
}